<%-- 
    Document   : editar
    Created on : 3/05/2010, 12:27:44 PM
    Author     : Damc
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
//borra el cache de la pag
response.setHeader( "Pragma", "no-cache" );
response.addHeader( "Cache-Control", "must-revalidate" );
response.addHeader( "Cache-Control", "no-cache" );
response.addHeader( "Cache-Control", "no-store" );
response.setDateHeader("Expires", 0);

HttpSession sesion = request.getSession();
try{
    if(!sesion.getAttribute("rol").equals(1) || sesion == null){
        sesion.invalidate();
        response.sendRedirect("../inicio.jsp");
    }
}catch(Exception w){ response.sendRedirect("../inicio.jsp");}
String error="";
try{
    error=(String)sesion.getAttribute("tabla");
    if(error==null)error="";
}catch(Exception e){error="";}



String nombre1=(String)sesion.getAttribute("nombre");
String apellido1=(String)sesion.getAttribute("apellido");
String mail=(String)sesion.getAttribute("mail");

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link href="../pagina.css" rel="stylesheet" type="text/css" />
        <script src="../js/Encriptacion.js" type="text/javascript"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>PubliFacil: Publicidad para todos</title>
    </head>
    <body>
        <jsp:include page="../pag/cabe.jspf"/>
        <jsp:include page="../pag/izqP.jsp"/>
        <div id="central" class="clear-block">
            <div align="center">
                <h3>Informacion de Personal</h3>
                (Los campos con * son obligatorios)
            </div>
            <div align="center">
                <form name="edicion" method="post" action="../ControlUsuario" onsubmit="document.edicion.pass0.value = hex_md5(document.edicion.pas0.value);document.edicion.pass1.value = hex_md5(document.edicion.pas1.value);document.edicion.pass2.value = hex_md5(document.edicion.pas2.value);">
                    <input type="hidden" name="request" value="editar">
                    <table align="center">
                        <tbody>
                            <tr>
                                <td>Nombre:</td>
                                <td><input name="nombre" type="text" maxlength="45" value="<%=nombre1%>"></td>
                            </tr>
                            <tr>
                                <td>Apellido:</td>
                                <td><input name="apellido" type="text" maxlength="45" value="<%=apellido1%>"></td>
                            </tr>
                            <tr>
                                <td>E-mail:</td>
                                <td><input name="mail" type="text" maxlength="45" value="<%=mail%>"></td>
                            </tr>
                            <tr>
                                <td>Si no quiere cambiar de contraseña deje en blanco</td>
                            </tr>
                            <tr>
                                <td>Anterior Contraseña:</td>
                                <td>
                                    <input type="hidden" name="pass0" value="">
                                    <input name="pas0" type="password" maxlength="45" value="">
                                </td>
                            </tr>
                            <tr>
                                <td>Nueva Contraseña</td>
                                <td>
                                    <input type="hidden" name="pass1" value="">
                                    <input name="pas1" type="password" maxlength="45" value="">
                                </td>
                            </tr>
                            <tr>
                                <td>Repita la nueva contraseña:</td>
                                <td>
                                    <input type="hidden" name="pass2" value="">
                                    <input name="pas2" type="password" maxlength="45" value="">
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <input name="boton" type="submit" value="Actualizar" align="center">
                    <br>
                    <%=error%>
                </form>
                </div>
        </div>
        <jsp:include page="../pag/rede.jspf"/>
    </body>
</html>
